home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume5 / flicker < prev    next >
Encoding:
Text File  |  1988-08-30  |  2.3 KB  |  85 lines

  1. Path: uunet!tektronix!tekgen!tekred!games
  2. From: games@tekred.TEK.COM
  3. Newsgroups: comp.sources.games
  4. Subject: v05i060:  flicker - ANSI terminal teaser
  5. Message-ID: <2990@tekred.TEK.COM>
  6. Date: 31 Aug 88 17:47:40 GMT
  7. Sender: billr@tekred.TEK.COM
  8. Lines: 74
  9. Approved: billr@saab.CNA.TEK.COM
  10.  
  11. Submitted by: "Gene H. Olson" <gene@zeno.mn.org>
  12. Comp.sources.games: Volume 5, Issue 60
  13. Archive-name: flicker
  14.  
  15.     [Cute use of ANSI escape sequences. It works as advertised.  -br]
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of shell archive."
  24. # Contents:  README flicker.c
  25. # Wrapped by billr@saab on Wed Aug 31 10:45:09 1988
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f 'README' -a "${1}" != "-c" ; then 
  28.   echo shar: Will not clobber existing file \"'README'\"
  29. else
  30. echo shar: Extracting \"'README'\" \(248 characters\)
  31. sed "s/^X//" >'README' <<'END_OF_FILE'
  32. XNo explanations given or required.  I promise this program will not
  33. Xdamage your terminal, although it may look for a moment as if it is
  34. Xdoing so.
  35. X
  36. XEnjoy, and be sensible.  (Use Interrupt to exit the program.)
  37. X
  38. XGene H. Olson
  39. Xamdahl!bungia!zeno!gene
  40. END_OF_FILE
  41. if test 248 -ne `wc -c <'README'`; then
  42.     echo shar: \"'README'\" unpacked with wrong size!
  43. fi
  44. # end of 'README'
  45. fi
  46. if test -f 'flicker.c' -a "${1}" != "-c" ; then 
  47.   echo shar: Will not clobber existing file \"'flicker.c'\"
  48. else
  49. echo shar: Extracting \"'flicker.c'\" \(360 characters\)
  50. sed "s/^X//" >'flicker.c' <<'END_OF_FILE'
  51. X#define N 1000
  52. X
  53. Xextern char *malloc() ;
  54. Xextern char *strcpy() ;
  55. X
  56. Xmain()
  57. X{
  58. X    register int i ;
  59. X    register int s ;
  60. X    register char *p ;
  61. X    register char *buf ;
  62. X    register char *str ;
  63. X
  64. X    str = "\033[H\033[4L\033[4M" ;
  65. X    s = strlen(str) ;
  66. X    buf = p = malloc(N*s+1) ;
  67. X
  68. X    for (i = 0 ; i < N ; i++) {
  69. X        strcpy(p, str) ;
  70. X        p += s ;
  71. X        }
  72. X
  73. X    for (;;) {
  74. X        write(1, buf, N*s) ;
  75. X        }
  76. X    }
  77. END_OF_FILE
  78. if test 360 -ne `wc -c <'flicker.c'`; then
  79.     echo shar: \"'flicker.c'\" unpacked with wrong size!
  80. fi
  81. # end of 'flicker.c'
  82. fi
  83. echo shar: End of shell archive.
  84. exit 0
  85.